<!--
 * @Author: ITDLCL
 * @Date: 2024-11-05 17:03:45
 * @LastEditors: ITDLCL
 * @Description:
-->
<!-- 历史订单 - Tab切换 -->
<template>
  <view class="tabs border-top border-bottom d-flex">
    <view
      class="tabs_cell"
      v-for="(item, index) in tabList"
      :key="item.es_name"
      @click="tabClick(index)"
      :class="{ actived: index == tabIndex, 'border-right': index == 1, 'border-left': index == 1 }"
    >
      <text class="siyuan-medium">{{ item.name }}</text>
      <br />
      <text class="intel-one-mono-medium">{{ item.es_name }}</text>
    </view>
  </view>
</template>

<script setup>
import { ref } from "vue";

let props = defineProps({
  tabIndex: {
    type: Number,
    default: 0,
  },
});
let emits = defineEmits(["update:tabIndex"]);

let tabList = ref([
  {
    name: "活动",
    es_name: "Activity",
  },
  {
    name: "自习室",
    es_name: "Studyroom",
  },
  {
    name: "会议室",
    es_name: "Meetingroom",
  },
]);

const tabClick = index => {
  emits("update:tabIndex", index);
};
</script>

<style lang="scss" scoped>
.tabs {
  align-items: center;
  justify-content: space-between;

  &_cell {
    flex: 1;
    padding: 38rpx 0 32rpx;
    background-color: #f2f2f2;
    text-align: center;
    font-size: 26rpx;
    line-height: 34rpx;
  }
  &_cell.actived {
    background-color: #000000;
    text {
      color: #ffffff;
    }
  }
}
</style>
